<?xml version="1.0" encoding="UTF-8" ?>
<%@page import="com.mconnect.msurvey.model.User"%>
<%@page import="java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
	<title>mSurvey</title>
	<link rel="stylesheet" href="js/jQuery/themes/base/jquery.ui.all.css">
	<script src="js/jQuery/jquery-1.8.2.js"></script>
	<script src="js/jQuery/ui/jquery.ui.core.js"></script>
	<script src="js/jQuery/ui/jquery.ui.widget.js"></script>
	<script src="js/jQuery/ui/jquery.ui.button.js"></script>
	<link rel="stylesheet" href="js/jQuery/demos.css">
	
	<style type="text/css">
            @import "./js/dojo/dijit/themes/soria/soria.css";
            @import "./js/dojo/dojo/resources/dojo.css";
            #align-middle {height: 400px; overflow: hidden; position: relative;}
            #align-middle[id] {display: table; position: static;}
            #middle-wrap {position: absolute; top: 50%;} /* tylko dla IE */
            #middle-wrap[id] {display: table-cell; vertical-align:
                                  middle; width: 100%; position: static;}
            #middle {position: relative; top: -50%} /* tylko dla IE */
            #middle[id] {position: static;}
            .border {border: 1px solid #000; background-color: #eee;}

        </style>
	
</head>
<body class="soria">
<div  style="min-height: 500px;" >
            <div  style="height:23%;border-color: white;background-color: #c2dfef;">
                <div region="top" style="height:96px;overflow: hidden !important;">
                    <div   >
                        <div  region="left" style="width: 49%;padding:0px;spacing:0px">
                            <table style="padding:0px;spacing:0px">
                                <tr>
                                    <td style="background-color: #c2dfef;color:black">
                                        <div  data-dojo-type="dijit/layout/ContentPane">
                                            <img src="./resources/images/top_logo.gif" width="84" height="59" alt="image001"/>
                                        </div>
                                    </td>
                                    <td style="background-color:#c2dfef;color:black">
                                        <div data-dojo-type="dijit/layout/ContentPane">
                                            mConnect<br/>al. Jana Pawła II 41c<br/>31-864 Kraków
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        
								
						
						
                        
                          <div data-dojo-type="dijit/layout/ContentPane" region="bottom" style="width: 100%;padding:0px;spacing:0px">
                            <table style="width:100%">
                                <tr>
                                    <td align="left" style="width:30%;">
                                        Miejsce: <input type="text" value="Kraków"  name="miasto" style="background-color: white;width: 150px" />
                                    </td>
                                    <td align="center" style="font-size: 20px">
                                        <b style="color:#3366FF">mSurvey</b>
                                    </td>
                                    
                                    <td align="right" style="width:30%">
                                    <% User user = (User) session.getAttribute("user"); 
                                    	if(user != null){ %>
                                    	<form action="login.jsp?id=logout" method="post">
                                    		<input type="submit" value="Wyloguj"  />
                                    	</form>
                                    	
                                    </td>
                                    <%} %>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
		<center>
		<% 
			if(user == null){ %>
			<% String message = request.getParameter("message"); 
				if(message != null){ %>
					<h2 style="color:white; background-color: red"><%=message %></h2>
				<%} %>
			<div style="margin-top: 100px; background-color: white; border-color: #3399CC; width: 20%; border-style: solid; ">
			<h2>Zaloguj się</h2>
			        		<form action="login.jsp?id=login" method="post">
							<table>
								<tr>
									<td>Login</td>
									<td><input type="text" name="login" /></td>
								</tr>
								<tr>
									<td>Hasło</td>
									<td><input type="password" name="password" /></td>
								</tr>
								<tr>
									<td colspan="2">&nbsp</td>
								</tr>
								<tr>
									<td colspan="2"><input type="submit" value="Zaloguj" /></td>
								</tr>
							</table>
						</form>
			     </div>
		<%}else{
			String type = request.getParameter("type");
			if(type == null){
		%>
				<div class="demo" style="margin-top: 100px;">
					<form action="index.jsp" method="get">
						<input type="submit" value="Ankieta" name="type" style="width: 200px; height: 40px;"/>
						<input type="submit" value="Ankieta Techniczna" name="type" style="width: 200px; height: 40px;"/>
					</form>
				</div>	
			<%}else if("Ankieta".equals(type)){ %>
				<jsp:forward page="surveyForm.jsp" />
		<%	}else if("Ankieta Techniczna".equals(type)){ %>
				<jsp:forward page="technicalSurveyForm.jsp" />
		<%	}
			
		
		} %>
		</center>
		<div style="overflow: hidden !important;background-color: #c2dfef; height:30px; margin-top: 100px; border-style: solid; border-color: #3399CC">
                    
                              <div style="font-size: normal;background-color: #c2dfef;color: black;alignment-adjust: middle" align="center" >© 2012 mConnect </div>
                </div>
	</div>
</div>
	
</body>
</html>